Skip to content

refactor(excel-export): switch to explicit fflate/browser entry#17122

Draft
damyanpetev wants to merge 1 commit intomasterfrom
dpetev/fflate-import
Draft

refactor(excel-export): switch to explicit fflate/browser entry#17122
damyanpetev wants to merge 1 commit intomasterfrom
dpetev/fflate-import

Conversation

@damyanpetev
Copy link
Copy Markdown
Member

The import from fflate when bundled by vitest with Playwright in Angular project causes this issue:
image
regardless of component, as long as igniteui-angular is present, because this is bunlded like so:
image

That's because by default vitest will include the node condition and browser when browser mode is on, but fflate exposes that as import instead so this is bundled:
image
Note: Can't seem to find a definitive standard on these conditions, this could be resolvable by a fix in the package too.

Alternative:

Tested with the following vitest config:

export default defineConfig({
  // https://vitest.dev/guide/common-errors.html#custom-package-conditions-are-not-resolved
  ssr: {
    resolve: {
      conditions: ['browser', 'import', 'default'],
    },
  },
  resolve: {
    conditions: ['browser', 'import', 'default'],
  },
  test: {
    browser: {
      provider: playwright(),
      enabled: true,
      // at least one instance is required
      instances: [
        { browser: 'chromium' },
      ],
    },
  }
});

But none of those worked, possibly not passed down by the angular process.
The only thing that did work was the alias:

export default defineConfig({
  resolve: {
    alias: [
      { find: /^fflate$/, replacement: 'fflate/browser' },
    ],
  },
  //...

Which might need to be documented if this PR doesn't work out - this needs to be evaluated for SSR scenarios.

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version: 21.2.x ❌ status: awaiting-test PRs awaiting manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants